package nickthissen.iracing.fragments;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import nickthissen.iracing.iracingforum2.R;

/**
 * Created by nthissen on 17/05/13.
 */
public abstract class ItemListFragment<E> extends Fragment
{
    public static final String URL = "URL";
    public static final String PAGE = "PAGE";

    protected E item;
    protected String url;
    protected int page;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        // The last two arguments ensure LayoutParams are inflated properly.
        View rootView = inflater.inflate(R.layout.threadlist_fragment, container, false);

        Bundle args = getArguments();
        url = args.getString(URL);
        page = args.getInt(PAGE);

        return rootView;
    }

    public abstract void startLoading ();

}
